import React, { Component } from 'react'
import './css/SwitchTab.less'
import { Link, withRouter } from 'react-router-dom'






class SwitchTab extends Component {

    constructor(props) {
        super(props)
        this.state = {

        }
    }

    componentDidMount() {
    }

    render() {
        var { params } = this.props
        return (
            <div className="SwitchTab">
                {
                    params.switchTabData.map((item, index) => {
                        return (
                            <div onClick={() => {
                                params.switchOnChange(item.value)
                            }} key={index} className={"itemBox " + (item.value === params.switchTabKey ? 'act' : '')}>
                                <div className="itemTitle">{item.label}</div>
                            </div>
                        )
                    })
                }
            </div>
        )
    }

}
export default withRouter(SwitchTab)